package com.hrpmar.mapper;

import com.hrpmar.controller.dto.PurplanDto;
import com.hrpmar.pojo.Purplan;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created by c on 2017-11-15.
 */
public interface PurplanMapper {

    /**
     * 分页条件查询采购主表
     * @param offset
     * @param limit
     * @param condition
     * @return
     */
    public List<Purplan> searchPurPlanByCondition(@Param("offset") Integer offset, @Param("limit") Integer limit, @Param("condition") PurplanDto condition);

    /**
     * 获取信息总条数
     * @param condition
     * @return
     */
    public Integer getTotal(@Param("condition") PurplanDto condition);

    /**
     * 根据编号获取信息
     * @param planNum
     * @return
     */
    public Purplan searchPurplanByNum(String planNum);

    /**
     * 获取最后一个采购编号
     * @return
     */
    public String searchLastPurNum();

    /**
     * 添加采购主表信息
     * @param purplan
     * @return
     */
    public int addPurplan(Purplan purplan);

    /**
     * 审核采购信息
     * @param planChstate
     * @param planViews
     * @return
     */
    public int auditPurplan(@Param("planNum") String planNum, @Param("planChstate") Integer planChstate,@Param("planViews") String planViews);

    /**
     * 修改采购入库状态
     * @param planRustate
     */
    public void upRuState(@Param("planRustate") Integer planRustate,@Param("planNum") String planNum);

}
